package com.foo.common.base.config;

import com.foo.common.base.component.BaseDataSourceCleanComponent;
import org.springframework.context.annotation.*;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@ComponentScan(value = "com.foo", includeFilters = {
        @Filter(type = FilterType.REGEX, pattern = ".*service"),
        @Filter(type = FilterType.REGEX, pattern = ".*dao")})
@PropertySource("classpath:startComponents.properties")
@ImportResource("classpath:applicationContext.xml")
@EnableTransactionManagement
public class CoreConfig {
    @Bean(name = "baseDataSourceClean", initMethod = "start")
    public BaseDataSourceCleanComponent baseDataSourceCleanComponent() {
        return BaseDataSourceCleanImpl.INSTANCE;
    }

}
